package controller;


import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.Window;

public class LoginController implements Initializable {

    @FXML
    private Button open;

    @FXML
    void openNewWin(ActionEvent event) {
    	Stage stage = new Stage();
        Parent root;
		try {
			root = FXMLLoader.load(getClass().getClassLoader().getResource("view/MainView.fxml"));
			stage.setScene(new Scene(root));
	        stage.setTitle("My modal window");
	        stage.initModality(Modality.WINDOW_MODAL);
	        stage.initOwner(
	            ((Node) event.getSource()).getScene().getWindow() );
	        stage.show();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        
    }

	@Override
	public void initialize(URL location, ResourceBundle resources) {
		// TODO Auto-generated method stub
		
	}


}
